<template>
	<el-dialog :title="dialogTitle" :visible.sync="visible" top="0" width="720px" append-to-body>
		<el-descriptions :column="3" size="medium" border class="subject_descriptions" v-loading="loading">
			<el-descriptions-item label="试题类型">kooriookami</el-descriptions-item>
			<el-descriptions-item label="试题类型">18100000000</el-descriptions-item>
			<el-descriptions-item label="试题状态"><el-tag size="small">学校</el-tag></el-descriptions-item>
			<el-descriptions-item label="试题类型"></el-descriptions-item>
			<el-descriptions-item label="试题类型">江苏省苏州市吴中区吴中大道 1188 号</el-descriptions-item>
		</el-descriptions>
	</el-dialog>
</template>

<script>
import { queryQuestions } from '@/api/exam/testSubjects';
export default {
	props: {
		value: { type: Boolean, default: false },
		dataId: { type: String, default: '' }
	},
	data() {
		return {
			loading: false,
			visible: this.value,
			subjectData: {}
		};
	},
	computed: {
		dialogTitle() {
			return '试题详情';
		}
	},
	watch: {
		value(flag) {
			this.visible = flag;
		},
		visible(flag) {
			this.$emit('input', flag);
			if (!flag) return false;
			this.loading = true;
			this.getQuestionsDetail();
		}
	},
	methods: {
		//获取试题详情
		async getQuestionsDetail() {
			let result = await queryQuestions(this.dataId).then((res) => res.data);
			this.loading = false;
			if (result.code === '0') {
				this.subjectData = this.$detailData(result.data);
			}
		}
	}
};
</script>

<style lang="scss" scoped>
.subject_descriptions {
	flex: 1;
	overflow: hidden;
}
</style>
